#include "util.h"

void *SafeMalloc(size_t size)
{
	void *ptr = malloc(size);
	if(ptr == NULL)
	{
		exit(-1);
	}
	return ptr;
}

size_t CalculateLength(BYTE length[4])
{
	return length[3] + length[2] * 256 + length[1] * 65536 + length[0] * 16777216;
}